<?php
/**
 * Created by PhpStorm
 * User: whh
 * Date: 2022/7/23
 * Time: 11:53
 */

namespace app\common\model;

use think\Model;

class NovelClass extends Model
{
    protected $table = 'novel_class';
    use Common;

    public function freq()
    {
        return $this->belongsToMany(NovelFreq::class, FreqToClassAccess::class, 'freq_id', 'class_id');
    }


    /**
     * 子分类
     * @return \think\model\relation\HasMany
     */
    public function subSonClass()
    {
        return $this->hasMany(NovelClassSon::class, 'class_id', 'id');
    }
}